<template>
  <div
    class="box"
    :class="{ active: row == 3, active1: row == 1, active2: row == 2 }"
  >
    <div class="banner"></div>
    <div class="f1">
      <div class="breadcrumb">
        <h6 @click="back">
          <img src="@/assets/home/back.png" alt="" />
          返回上一页
        </h6>
      </div>
      <div class="f1_content">
        <h6 class="title">信用报告</h6>
        <div class="typeList">
          <div class="typeList_f1">
            <h4 class="label"><span style="color: #f05">*</span> 报告类型</h4>
            <div class="type">
              <div
                class="type_list"
                v-for="(item, index) in list"
                :key="item.type"
                :class="{ active: row == index }"
                @click="row = index"
              >
                <h5>{{ item.type }}</h5>
                <h6 :class="{ active: row == index }"></h6>
                <div
                  style="
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                  "
                >
                  <span
                    style="font-size: 12px; font-weight: 200; color: #636363"
                    >{{ item.label1 }}</span
                  >
                  <span
                    style="font-size: 12px; font-weight: 200; color: #636363"
                    >{{ item.label2 }}</span
                  >
                </div>
                <div class="check" v-show="row == index">
                  <img src="@/assets/report/组101.png" alt="" />
                </div>
              </div>
            </div>
          </div>
          <div class="typeList_f1" style="align-items: center">
            <h4 class="label"><span style="color: #f05">*</span> 企业名称</h4>
            <el-form :model="ruleForm" class="demo-ruleForm">
              <el-form-item label="">
                <el-input disabled v-model="ruleForm.entname"></el-input>
              </el-form-item>
            </el-form>
          </div>
          <div class="typeList_f1" style="align-items: center">
            <h4 class="label">
              <span style="color: #f05">*</span> 统一社会信用代码
            </h4>
            <el-form :model="ruleForm" class="demo-ruleForm">
              <el-form-item label="">
                <el-input disabled v-model="ruleForm.credit_no"></el-input>
              </el-form-item>
            </el-form>
          </div>

          <div class="sample">
            <span @click="sample(row)"> 样本预览</span>
            <img src="@/assets/report/组102.png" alt="" />
          </div>
          <!-- 报告内容 -->
          <div class="typeList_f1" v-show="row == 0">
            <h4 class="label">报告内容</h4>
            <table id="table">
              <tbody id="tbody">
                <tr>
                  <td scope="row" class="td">商务信用评估</td>
                  <td scope="row">商务信用评分、风险提示</td>
                </tr>
                <!-- <tr>
                  <td scope="row" class="td">企业信用标签</td>
                  <td scope="row"></td>
                </tr>
                <tr>
                  <td scope="row" class="td">风险名单信息</td>
                  <td scope="row"></td>
                </tr> -->
                <tr>
                  <td scope="row" class="td">企业基本信息</td>
                  <td scope="row">登记信息、股东结构、主要人员、变更记录</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业关联信息</td>
                  <td scope="row">企业分支机构、企业对外投资、法人对外投资</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业涉诉信息</td>
                  <td scope="row">
                    涉诉情况概览、企业裁判文书、企业送达公告、企业开庭公告、企业执行公告、企业失信公告、企业终本案件、企业限制高消费
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业经营风险</td>
                  <td scope="row">
                    经营风险概览、行政处罚、经营异常、严重违法失信、股权出质、股权冻结
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">其他经营信息</td>
                  <td scope="row">
                    知识产权-著作权、知识产权-软件著作权、知识产权-域名、知识产权-商标信息、知识产权-专利信息、知识产权-资质证书、招投标
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="typeList_f1" v-show="row == 1">
            <h4 class="label">报告内容</h4>
            <table id="table">
              <tbody id="tbody">
                <tr>
                  <td scope="row" class="td">商务信用评估</td>
                  <td scope="row">商务信用评分、风险提示</td>
                </tr>
                <!-- <tr>
                  <td scope="row" class="td">企业信用标签</td>
                  <td scope="row"></td>
                </tr>
                <tr>
                  <td scope="row" class="td">风险名单信息</td>
                  <td scope="row"></td>
                </tr> -->
                <tr>
                  <td scope="row" class="td">企业基本信息</td>
                  <td scope="row">登记信息、股东结构、主要人员、变更记录</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业关联信息</td>
                  <td scope="row">企业分支机构、企业对外投资、法人对外投资</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业涉诉信息</td>
                  <td scope="row">
                    涉诉情况概览、企业裁判文书、企业送达公告、企业开庭公告、企业执行公告、企业失信公告、企业终本案件、企业限制高消费
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业经营风险</td>
                  <td scope="row">
                    经营风险概览、行政处罚、经营异常、严重违法失信、股权出质、股权冻结
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">其他经营信息</td>
                  <td scope="row">
                    知识产权-著作权、知识产权-软件著作权、知识产权-域名、知识产权-商标信息、知识产权-专利信息、知识产权-资质证书、招投标
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">财务信息</td>
                  <td scope="row">
                    整体财务状况、资产负债表、利润表、财务指标分析
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">税务信息</td>
                  <td scope="row">
                    税务评价、欠税信息、违法违章信息、申报征收信息
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">发票信息</td>
                  <td scope="row">
                    整体销售情况、企业近 12 个月主营商品分析、企业近 12
                    个月主要客户信息、整体采购情况、企业近 12
                    个月采购商品分析、企业近 12 个月供应商分析
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="typeList_f1" v-show="row == 2">
            <h4 class="label">报告内容</h4>
            <table id="table">
              <tbody id="tbody">
                <tr>
                  <td scope="row" class="td">商务信用评估</td>
                  <td scope="row">商务信用评分、风险提示</td>
                </tr>
                <!-- <tr>
                  <td scope="row" class="td">企业信用标签</td>
                  <td scope="row"></td>
                </tr>
                <tr>
                  <td scope="row" class="td">风险名单信息</td>
                  <td scope="row"></td>
                </tr> -->
                <tr>
                  <td scope="row" class="td">企业基本信息</td>
                  <td scope="row">登记信息、股东结构、主要人员、变更记录</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业关联信息</td>
                  <td scope="row">企业分支机构、企业对外投资、法人对外投资</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业涉诉信息</td>
                  <td scope="row">
                    涉诉情况概览、企业裁判文书、企业送达公告、企业开庭公告、企业执行公告、企业失信公告、企业终本案件、企业限制高消费
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业经营风险</td>
                  <td scope="row">
                    经营风险概览、行政处罚、经营异常、严重违法失信、股权出质、股权冻结
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">其他经营信息</td>
                  <td scope="row">
                    知识产权-著作权、知识产权-软件著作权、知识产权-域名、知识产权-商标信息、知识产权-专利信息、知识产权-资质证书、招投标
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">进出口贸易信息</td>
                  <td scope="row">
                    海关信用信息、整体出口情况、企业近
                    12个月出口商品情况、企业近
                    12个月出口国别情况、整体进口情况、企业近12个月进口商品情况、企业近
                    12 个月进口国别情况
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="typeList_f1" v-show="row == 3">
            <h4 class="label">报告内容</h4>
            <table id="table">
              <tbody id="tbody">
                <tr>
                  <td scope="row" class="td">商务信用评估</td>
                  <td scope="row">商务信用评分、风险提示</td>
                </tr>
                <!-- <tr>
                  <td scope="row" class="td">企业信用标签</td>
                  <td scope="row"></td>
                </tr>
                <tr>
                  <td scope="row" class="td">风险名单信息</td>
                  <td scope="row"></td>
                </tr> -->
                <tr>
                  <td scope="row" class="td">企业基本信息</td>
                  <td scope="row">登记信息、股东结构、主要人员、变更记录</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业关联信息</td>
                  <td scope="row">企业分支机构、企业对外投资、法人对外投资</td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业涉诉信息</td>
                  <td scope="row">
                    涉诉情况概览、企业裁判文书、企业送达公告、企业开庭公告、企业执行公告、企业失信公告、企业终本案件、企业限制高消费
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">企业经营风险</td>
                  <td scope="row">
                    经营风险概览、行政处罚、经营异常、严重违法失信、股权出质、股权冻结
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">其他经营信息</td>
                  <td scope="row">
                    知识产权-著作权、知识产权-软件著作权、知识产权-域名、知识产权-商标信息、知识产权-专利信息、知识产权-资质证书、招投标
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">财务信息</td>
                  <td scope="row">
                    整体财务状况、资产负债表、利润表、财务指标分析
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">税务信息</td>
                  <td scope="row">
                    税务评价、欠税信息、违法违章信息、申报征收信息
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">发票信息</td>
                  <td scope="row">
                    整体销售情况、企业近12个月主营商品分析、企业近12个月主要客户信息、整体采购情况、企业近12个月采购商品分析、企业近12个月供应商分析
                  </td>
                </tr>
                <tr>
                  <td scope="row" class="td">进出口贸易信息</td>
                  <td scope="row">
                    海关信用信息、整体出口情况、企业近 12
                    个月出口商品情况、企业近 12
                    个月出口国别情况、整体进口情况、企业近12
                    个月进口商品情况、企业近 12 个月进口国别情况
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div
            class="typeList_f1"
            style="align-items: center"
            v-show="row != 0"
          >
            <h4 class="label" style="margin-top: -14px">
              <span style="color: #f05">*</span> 手机号
            </h4>
            <el-form :model="ruleForm" class="demo-ruleForm" :rules="rules">
              <el-form-item label="" prop="phone">
                <el-input
                  @blur="appFincerPhone(ruleForm.phone)"
                  v-model="ruleForm.phone"
                ></el-input>
              </el-form-item>
            </el-form>
          </div>
          <!-- 数据授权说明 -->
          <div class="typeList_f1" style="margin-top: 15px" v-show="row == 1">
            <h4 class="label">数据授权说明</h4>
            <div class="explain">
              <p>
                您选择的报告版本包含财税数据分析，其相关数据的获取需被查询企业进行授权采集操作，稍后我们将通过预留的手机号与您取得联系并发送相关操作说明，请及时联系被查询企业进行数据采集，确认完成后请至个人中心查看报告记录。
              </p>
            </div>
          </div>
          <div class="typeList_f1" style="margin-top: 15px" v-show="row == 2">
            <h4 class="label">数据授权说明</h4>
            <div class="explain">
              <p>
                您选择的报告版本包含海关数据分析，其相关数据的获取需被查询企业进行授权采集操作，稍后我们将通过预留的手机号与您取得联系并发送相关操作说明，请及时联系被查询企业进行数据采集，确认完成后请至个人中心查看报告记录。
              </p>
            </div>
          </div>
          <div class="typeList_f1" style="margin-top: 15px" v-show="row == 3">
            <h4 class="label">数据授权说明</h4>
            <div class="explain">
              <p>
                您选择的报告版本包含财税数据分析、海关数据分析，其相关数据的获取需被查询企业进行授权采集操作，稍后我们将通过预留的手机号与您取得联系并发送相关操作说明，请及时联系被查询企业进行数据采集，确认完成后请至个人中心查看报告记录。
              </p>
            </div>
          </div>
        </div>
        <!-- 服务协议 -->
        <div class="agreement">
          <img
            @click="submitBtn()"
            :src="require(`@/assets/home/组${radio ? '89' : '90'}.png`)"
            alt=""
          />
          <span> 阅读并同意 </span>
          <a
            href="https://operate.thunlink.cn/reporttest/sys/用户服务协议.pdf"
            target="_back"
            >《用户服务协议》</a
          >
        </div>
        <div class="btn">
          <button
            :disabled="isLock"
            @click="goRiskDetails"
            :class="{ active: row == 1 || row == 3 }"
          >
            {{ row == 1 || row == 3 ? "敬请期待" : "提交" }}
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { myPostFetch } from "@/api/report";
export default {
  data() {
    return {
      row: 0,
      list: [
        {
          type: "基础版",
          label1: "快速了解",
          label2: "企业基本信息",
          reporttype: 1,
        },
        {
          type: "标准版A",
          label1: "深度财务分析",
          label2: "和信用评估",
          reporttype: 2,
        },
        {
          type: "标准版B",
          label1: "全面贸易信息解析",
          label2: "和风险评估",
          reporttype: 3,
        },
        {
          type: "高级版",
          label1: "多维度评估",
          label2: "企业信用资质",
          reporttype: 4,
        },
      ],
      isLock: false,
      radio: false, //企业授权服务状态变量
      native: 1,
      ruleForm: {
        credit_no: "",
        entname: "",
        phone: "",
      },
      rules: {
        phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
      },
    };
  },
  mounted() {
    this.ruleForm.credit_no = sessionStorage.getItem("credit_no");
    this.ruleForm.entname = sessionStorage.getItem("matchItems");
    document.documentElement.scrollTop = 0;
  },
  methods: {
    // 校验手机号
    appFincerPhone(phone) {
      let value = Number(phone);
      let reg = /^1[3-9]\d{9}$/;
      if (!reg.test(value)) {
        this.ruleForm.phone = "";
      }
    },
    // 返回上一页
    back() {
      this.$router.go(-1);
    },
    // 查看样本预览
    sample(row) {
      let url = "";
      if (row == 0) {
        url = "https://operate.thunlink.cn/reporttest/sys/报告样例-基础版.pdf";
      } else if (row == 1) {
        url = "https://operate.thunlink.cn/reporttest/sys/报告样例-标准版A.pdf";
      } else if (row == 2) {
        url = "https://operate.thunlink.cn/reporttest/sys/报告样例-标准版B.pdf";
      } else if (row == 3) {
        url = "https://operate.thunlink.cn/reporttest/sys/报告样例-高级版.pdf";
      }
      const a = document.createElement("a"); // 动态创建a标签，防止下载大文件时，用户没看到下载提示连续点击
      a.setAttribute("target", "_blank");
      a.href = url;
      a.click();
    },
    submitBtn() {
      this.radio = !this.radio;
    },
    async goRiskDetails() {
      this.isLock = true;
      setTimeout(() => {
        this.isLock = false;
      }, 3000);
      if (this.row == 1 || this.row == 3) return;
      if (!this.radio) return this.$Message.error("请勾选协议");
      if (this.ruleForm.phone == "" && this.row != 0)
        return this.$Message.error("请输入手机号");

      let reporttype =
        this.row + 1 == 1
          ? 3
          : this.row + 1 == 2
          ? 1
          : this.row + 1 == 3
          ? 2
          : 4;
      let url = "/zb/addBusinessReport";
      let params = {
        entname: this.ruleForm.entname,
        codeid: this.ruleForm.credit_no,
        reporttype: reporttype,
        phone: this.ruleForm.phone,
      };
      let data = await myPostFetch(url, params);
      if (data.msg == "操作成功") {
        this.$router.push("/submit");
      }
    },
  },
};
</script>

<style lang="scss" scoped>
/*去掉列表前面的小点*/
ul {
  list-style: none;
}
.box {
  position: relative;
  width: 100%;
  height: 1345px;
  box-sizing: border-box;
  padding-bottom: 80px;
  background: #f5f7fa;
  &.active {
    height: 1645px;
  }
  &.active1 {
    height: 1615px;
  }
  &.active2 {
    height: 1514px;
  }
  .banner {
    position: absolute;
    width: 100%;
    height: 200px;
    background: url(@/assets/report/组99.png);
    background-size: 100% 100%;
    z-index: 0;
  }
  .f1 {
    width: 100%;
    position: absolute;
    .breadcrumb {
      position: relative;
      margin: 0 auto;
      width: 1200px;
      height: 76px;
      background-color: rgba(255, 255, 255, 0);
      h6 {
        position: absolute;
        right: 35px;
        box-sizing: border-box;
        padding-top: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: 100%;
        font-size: 16px;
        font-weight: 300;
        color: #ffffff;
        text-decoration: underline;
        img {
          width: 16px;
          margin-right: 8px;
        }
      }
    }
    .f1_content {
      box-sizing: border-box;
      padding: 22px 30px;
      margin: 0 auto;
      width: 1200px;
      // height: 3.3073px;
      background: #fff;
      border-radius: 4px;
      .title {
        text-align: center;
        width: 100%;
        height: 55px;
        font-size: 28px;
        font-weight: 500;
        color: #000000;
        border-bottom: 1px solid #e0e0e0;
      }
      .typeList {
        box-sizing: border-box;
        padding-top: 50px;
        margin: 0 auto;
        width: 900px;
        .sample {
          cursor: pointer;
          display: flex;
          justify-content: flex-end;
          align-items: center;
          width: 690px;
          height: 30px;
          margin: 0 auto;
          font-size: 14px;
          font-family: Source Han Sans SC;
          font-weight: 300;
          color: #4898e0;
          img {
            width: 5px;
            height: 10px;
            margin-left: 8px;
          }
        }
        // height: 0.901px;
        .typeList_f1 {
          display: flex;
          margin-bottom: 15px;
          .label {
            text-align: right;
            width: 150px;
            margin-right: 48px;
            font-size: 15px;
            font-family: Source Han Sans SC;
            font-weight: 500;
            color: #111;
          }
          .type {
            display: flex;
            justify-content: space-between;
            width: 600px;
            height: 90px;
            margin-bottom: 40px;
            .type_list {
              position: relative;
              cursor: pointer;
              display: flex;
              flex-direction: column;
              justify-content: space-between;
              align-items: center;
              box-sizing: border-box;
              padding: 11px 0;
              width: 141px;
              height: 90px;
              background-color: #fff;
              border: 1px solid #ccc;
              border-radius: 4px;
              &.active {
                border: 1px solid #0a7be0;
                background: rgba(10, 123, 224, 0.1);
              }
              h5 {
                text-align: center;
                font-size: 16px;
                font-weight: 400;
                color: #000000;
              }
              h6 {
                width: 90px;
                height: 1px;
                background: #dcdcdc;
                &.active {
                  background: #0a7be0;
                }
              }
              .check {
                width: 24px;
                height: 24px;
                position: absolute;
                bottom: -0px;
                right: -0px;
                // background: url(@/assets/report/三角形.png);
                // background-size: 100% 100%;
                img {
                  width: 27px;
                  height: 24px;
                  position: absolute;
                  right: 0px;
                  bottom: 0px;
                  z-index: 999;
                }
              }
            }
          }
          // 表格
          table {
            width: 600px;
            margin-bottom: 30px;
            border-collapse: collapse;
          }
          table td {
            box-sizing: border-box;
            height: 42px;
            border: 1px solid #dbdbdb;
            padding: 10px 20px;
            font-size: 15px;
            font-family: SourceHanSansSC-Light;
            font-weight: 500;
            color: #545454;
            line-height: 26px;
          }
          table .td {
            width: 180px;
            font-size: 15px;
            font-weight: 500;
            color: #000000;
            text-align: center;
            background-color: #f2f9fc;
          }
          //数据授权说明
          .explain {
            box-sizing: border-box;
            padding: 23px 35px;
            width: 600px;
            background: #f0f0f0;
            p {
              font-size: 14px;
              font-family: Source Han Sans SC;
              font-weight: 300;
              color: #545454;
              line-height: 26px;
            }
          }
        }
      }
      // 服务协议
      .agreement {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 25px;
        text-align: center;
        margin: 20px 0;
        user-select: none;
        span {
          font-size: 14px;
          color: #666;
          margin-left: 7px;
        }
        img {
          width: 15px;
          height: 15px;
          cursor: pointer;
        }
        a {
          cursor: pointer;
          font-size: 14px;
          color: #3f6ef2;
        }
      }
      .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;

        button {
          font-weight: 600;
          cursor: pointer;
          align-items: center;
          justify-content: center;
          display: flex;
          border-radius: 5px;
          width: 230px;
          height: 40px;
          background: #0a7be0;
          font-size: 16px;
          font-weight: 300;
          color: #ffffff;
          &.active {
            background-color: #8e8e8e;
          }
        }
      }
    }
  }
}
/* 输入框样式  */
::v-deep .el-input__inner {
  font-size: 12px;
  box-sizing: border-box;
  width: 600px;
  height: 37px;
  font-size: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 0px;
  padding: 10px 10px;
  color: #606266;
  outline: 0;
  line-height: 35px !important;
}
::v-deep .el-form-item {
  margin-bottom: 10px;
}
</style>
